//
//  BaseViewController.swift
//  手账
//
//  Created by zhuxiaoxiang on 2018/12/12.
//  Copyright © 2018年 zhuxiaoxiang. All rights reserved.
//

import UIKit
import MBProgressHUD

class BaseViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        config()
    }
    
    func config() {
        self.navigationController?.navigationBar.isTranslucent = false
        self.navigationController?.navigationBar.tintColor = UIColor.hex(hexString: "999999")
    }
    
    func configBackItem() {
        self.navigationItem.leftBarButtonItem = UIBarButtonItem(image: UIImage(named: "back")?.withRenderingMode(.alwaysOriginal), style: .plain, target: self, action: #selector(back))
    }

}

extension BaseViewController {
    func showMessage(_ text: String) {
        XXHUD.sharedInstance.showMessage(view: self.view, text)
    }
    
    @objc func back() {
        self.navigationController?.popViewController(animated: true)
    }
}

